package TextZone;

import java.awt.Color;
import java.io.File;
import java.util.Collection;
import java.util.Hashtable;

import javax.swing.JTextPane;

import Nuplet.Pair;


public abstract class TextZone extends JTextPane {

	/**
	 * 
	 */
	private static final long serialVersionUID = -5078940853265498270L;
	private int numline;
	private int numcolonne;
	protected int revision;
	private int savedrevision;
	private String fileext;
	private String path;
	public TextZone(String path){
		super();
		this.setName(path);
		numline=0;
		savedrevision=0;
	}
	public void setName(String npath){
		path=npath;
		int i=path.lastIndexOf(File.separatorChar);
		if (i>10) super.setName(path.substring(i+1));
		else super.setName(path);
	}
	public void setnumline(int pos) {
		numline=pos;
	}
	public int getnumline(){
		return numline;
	}
	public void setsaved(){
		savedrevision=revision;
	}
	public boolean getsaved() {
		return savedrevision==revision;
	}
	public abstract void addToColorMap(String a,String b);
	public abstract void ColorMapReset();
	public abstract void setColorMap( Hashtable<String,String> cm);
	public abstract void setSeparator( Collection<Character> sep);
	public abstract void setFontSize(int size);
	public void setFileext(String fileext) {
		this.fileext = fileext;
	}
	public String getFileext() {
		return fileext;
	}
	public String[] getFontes(){
		return FontUtil.getfontes();
	}
	public void setPath(String path) {
		this.path = path;
	}
	public String getPath() {
		return path;
	}
	public void setRevision(int revision) {
		this.revision = revision;
	}
	public int getRevision() {
		return revision;
	}
	public abstract void color_zone(int deb,int fin,Color floating);
	public void setnumcolonne(int numcolonne) {
		this.numcolonne = numcolonne;
	}
	public int getnumcolonne() {
		return numcolonne;
	}
}
